﻿Imports Kudos2Mod.Common
Public Class MainMenuForm

    Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
        MsgBox("This should either be the path to ""%ProgramFiles%\Positech Games\Kudos 2"" or it should be your ""%MyDocuments%\Kudos 2"" directory", MsgBoxStyle.Information + MsgBoxStyle.Information, "Kudos 2 Path")
    End Sub

    Private Sub FolderBrowseButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FolderBrowseButton.Click
        If FolderBrowserDialog.ShowDialog() <> Windows.Forms.DialogResult.Cancel Then
            If CheckForFileExists(FolderBrowserDialog.SelectedPath.ToString & "\strings.ini") Then
                FilePathTextBox.Text = FolderBrowserDialog.SelectedPath.ToString
                FilesPath = FilePathTextBox.Text
            Else
                MsgBox("That path does not contain the strings.ini file, please check the path.")
            End If
        End If
    End Sub

    Private Function CheckForFileExists(ByVal fileToCheck As String) As Boolean
        Dim retval As Boolean = False
        If IO.File.Exists(fileToCheck) Then
            retval = True
        End If
        CheckForFileExists = retval
    End Function

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim ae As New AssetEditor
        ae.Show()
    End Sub

    Private Sub MainMenuForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '' Debug code from work, points to Kudos2Mod directory on USB drive
        FilePathTextBox.Text = "G:\Kudos2Mod"
        FilesPath = FilePathTextBox.Text
        '' End debug code
    End Sub
End Class
